package demo02;

import javax.swing.*;
import java.awt.*;

public class Demo extends JPanel {
    public static void main(String[] args) {
        Demo demo = new Demo();
        JFrame frame = new JFrame();
        JButton jb = new JButton("dsi");
        Component c = new Component() {
            @Override
            public Dimension getSize(Dimension rv) {
                return super.getSize(rv);
            }
        };
        frame.add(demo);
        frame.add(jb);
        frame.setSize(400,600);
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.setLocationRelativeTo(null);
        frame.setVisible(true);
    }
}
